import rsa
(pubkey, privkey) = rsa.newkeys(2048)

pub = pubkey.save_pkcs1()
pri = privkey.save_pkcs1()


print("pub:%s" % pub)
print("pri:%s" % pri)


with open('public_key_pem.pem', 'wb') as f:
    f.write(pub)

with open('private_key_pem.pem', 'wb') as f:
    f.write(pri)
